﻿using System;
using CID.Execution.Support.Contracts;
using NailsFramework;

namespace CID.Execution.Controller.Service
{
    /// <summary>
    /// Wraps an <see cref="IControllerService"/> in a concrete class that will be exposed as WCF so that the implementation
    /// can be injected through the Nails inversion of control
    /// </summary>
    class ControllerServiceWCFWrapper : IControllerService
    {
        private IControllerService Controller { get; set; }

        public ControllerServiceWCFWrapper()
        {
            Controller = Nails.ObjectFactory.GetObject<IControllerService>();
        }

        public void NotifyDeactivationCompleted(Guid deploymentUniqueIdentifier, int locationId, string details, bool error)
        {
            Controller.NotifyDeactivationCompleted(deploymentUniqueIdentifier, locationId, details, error);
        }

        public void NotifyDeploymentCompleted(Guid deploymentUniqueIdentifier, int locationId, string details, bool error)
        {
            Controller.NotifyDeploymentCompleted(deploymentUniqueIdentifier, locationId, details, error);
        }

        public void NotifyActivationCompleted(Guid deploymentUniqueIdentifier, int locationId, string details, bool error)
        {
            Controller.NotifyActivationCompleted(deploymentUniqueIdentifier, locationId, details, error);
        }
    }
}
